<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>360开关机动画</title>
    <script src="js/jquery-3.2.1.min.js"></script>
    <style>
        .box{
            width: 322px;
            position: fixed;
            bottom: 0;
            right: 0;
            overflow: hidden;
        }
        span{
            position: absolute;
            top: 0;
            right: 0;
            width: 30px;
            height: 20px;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div class="box" id="box">
        <span id="closeButton"></span>
        <div class="hd" id=headPart>
            <img src='images/t.jpg' alt="">
        </div>
        <div class="bd" id="bottomPart">
            <img src="images/b.jpg" alt="">
        </div>
    </div>
</body>
<script>
    /**
     *  a)	给关闭按钮一个点击事件
        b)	让下面那部分的高度动画变为0
        c)	让整个大盒子的宽度动画变为0
     */
$(function(){
    $("#closeButton").click(function(){
        $("#bottomPart").animate({
            height:0
        },500,function(){
            $('#box').animate({
                width:0
            },1000)
        });
    });
});
</script>
</html>